Skip to content

Missing compatibility layer functionality #10518

Open
Roy-Carter wants to merge 5 commits into
wolfSSL:masterfrom
Roy-Carter:feature/missing_openssl_functionality
Open

Missing compatibility layer functionality #10518
Roy-Carter wants to merge 5 commits into
wolfSSL:masterfrom
Roy-Carter:feature/missing_openssl_functionality

Conversation

@Roy-Carter

Copy link
Copy Markdown
Contributor

Description

Implement needed as part of migrating from OpenSSL -> WolfSSL
wolfSSL_SSL_CIPHER_find - find cipher by 2 bytes in wired like openssl
wolfSSL_sk_SSL_CIPHER_delete - remove cipher at given index
SSL_clear_chain_certs

Testing

created unitests .

Checklist

  • [*] added tests
  • [*] updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@Roy-Carter

Copy link
Copy Markdown
Contributor Author

@julek-wolfssl adding PR for the 3 functions i've seen problems with (missing functionality) lmk what you think

@wolfSSL-Bot

Copy link
Copy Markdown

Can one of the admins verify this patch?

@Roy-Carter

Copy link
Copy Markdown
Contributor Author

Hey @julek-wolfssl before I fix anything here since I wasn't 100% sure this is correct implementation I'd like if you can verify on your end if it's fine or not before I continue editing this

@dgarske dgarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Roy-Carter looks like issue with --enable-asynccrypt "FAIL: scripts/unit.test"

@dgarske dgarske assigned Roy-Carter and unassigned julek-wolfssl May 26, 2026

@julek-wolfssl julek-wolfssl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like a test to check that the connection still completes after a call to SSL_clear_chain_certs.

Comment thread src/ssl.c Outdated
Comment thread src/ssl_sk.c Outdated
@Roy-Carter Roy-Carter force-pushed the feature/missing_openssl_functionality branch from 3e105d7 to 5f597d8 Compare May 29, 2026 12:24
@Roy-Carter

Copy link
Copy Markdown
Contributor Author

I would like a test to check that the connection still completes after a call to SSL_clear_chain_certs.

Regarding this without the PR fix of #10517 there's a segfault in clear , so just for the sake of the test + fix i've added the two bugs I encountered as part of the test because wolfSSL_add0_chain_cert never increments certChainCnt (CTX version does), and clear_chain_certs never resets it thus TLS 1.3 send walks a freed/NULL
chain. so maybe worth just closing the other one and sticking to this one for the addition of clearing also.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds three OpenSSL compatibility layer functions needed for application migration: SSL_CIPHER_find, sk_SSL_CIPHER_delete, and SSL_clear_chain_certs, with unit tests and a corresponding fix that increments ssl->buffers.certChainCnt when wolfSSL_add0_chain_cert succeeds.

Changes:

  • New wolfSSL_SSL_CIPHER_find walks the SSL's cipher list to match by a 2-byte wire-format suite id.
  • New wolfSSL_sk_SSL_CIPHER_delete removes a cipher from a stack at a given index, returning a heap copy.
  • New wolfSSL_clear_chain_certs frees the SSL's added chain certs and resets ownership; add0_chain_cert now bumps certChainCnt.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
wolfssl/ssl.h Public prototypes for the three new APIs
wolfssl/openssl/ssl.h OpenSSL-style macro aliases for the three new APIs
src/ssl.c Implementation of wolfSSL_SSL_CIPHER_find
src/ssl_sk.c Implementation of wolfSSL_sk_SSL_CIPHER_delete using wolfSSL_sk_pop_node
src/ssl_load.c Implementation of wolfSSL_clear_chain_certs and certChainCnt++ fix in add0_chain_cert
tests/api.c New unit tests for the three APIs and a handshake-after-clear test

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ssl.c
Comment thread src/ssl_load.c

@julek-wolfssl julek-wolfssl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the copilot comment and fix the CI. Thanks.

@dgarske dgarske removed their request for review June 1, 2026 17:09
wolfSSL_SSL_CIPHER_find - find cipher by 2 bytes in wired like openssl
wolfSSL_sk_SSL_CIPHER_delete - remove cipher at given index
SSL_clear_chain_certs
@Roy-Carter Roy-Carter force-pushed the feature/missing_openssl_functionality branch from 1218b1c to efbe5f7 Compare June 7, 2026 07:30
@Roy-Carter

Copy link
Copy Markdown
Contributor Author

@julek-wolfssl can we re run workflow see if its working now ?

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants